using ClassDemo.Model.Entity;

namespace ClassDemo.Service;

/// <summary>
/// 学生服务接口
/// </summary>
public interface IStudentService
{
    /// <summary>
    /// 获取所有学生
    /// </summary>
    /// <returns>学生列表</returns>
    Task<List<Student>> GetAllStudentsAsync();

    /// <summary>
    /// 根据ID获取学生
    /// </summary>
    /// <param name="id">学生ID</param>
    /// <returns>学生信息</returns>
    Task<Student?> GetStudentByIdAsync(int id);

    /// <summary>
    /// 根据学号获取学生
    /// </summary>
    /// <param name="studentNo">学号</param>
    /// <returns>学生信息</returns>
    Task<Student?> GetStudentByNoAsync(string studentNo);

    /// <summary>
    /// 分页获取学生列表
    /// </summary>
    /// <param name="pageIndex">页码</param>
    /// <param name="pageSize">页大小</param>
    /// <param name="keyword">搜索关键词</param>
    /// <returns>分页结果</returns>
    Task<(List<Student> Data, int Total)> GetStudentsPageAsync(int pageIndex, int pageSize, string? keyword = null);

    /// <summary>
    /// 根据班级获取学生列表
    /// </summary>
    /// <param name="className">班级名称</param>
    /// <returns>学生列表</returns>
    Task<List<Student>> GetStudentsByClassAsync(string className);

    /// <summary>
    /// 根据专业获取学生列表
    /// </summary>
    /// <param name="major">专业</param>
    /// <returns>学生列表</returns>
    Task<List<Student>> GetStudentsByMajorAsync(string major);

    /// <summary>
    /// 添加学生
    /// </summary>
    /// <param name="student">学生信息</param>
    /// <returns>操作结果</returns>
    Task<(bool Success, string Message)> AddStudentAsync(Student student);

    /// <summary>
    /// 更新学生信息
    /// </summary>
    /// <param name="student">学生信息</param>
    /// <returns>操作结果</returns>
    Task<(bool Success, string Message)> UpdateStudentAsync(Student student);

    /// <summary>
    /// 删除学生
    /// </summary>
    /// <param name="id">学生ID</param>
    /// <returns>操作结果</returns>
    Task<(bool Success, string Message)> DeleteStudentAsync(int id);

    /// <summary>
    /// 批量删除学生
    /// </summary>
    /// <param name="ids">学生ID列表</param>
    /// <returns>操作结果</returns>
    Task<(bool Success, string Message)> DeleteStudentsAsync(List<int> ids);
}